class Solution(object):
    def hammingDistance(self, x, y):
        """
        :type x: int
        :type y: int
        :rtype: int
        """
        xor = x ^ y
        count = 0
        while xor:
            count += (xor & 1)
            xor >>= 1
        return count
if __name__ == '__main__':
    s = Solution()
    print(s.hammingDistance(1, 4))